

package com.hazelcast.jet.pipeline.file;

import javax.annotation.Nonnull;
import java.io.Serial;

/**
 * {@code FileFormat} for binary files where the whole file is one {@code
 * byte[]} item. See {@link FileFormat#bytes} for more details.
 *
 * @since Jet 4.4
 */
public class RawBytesFileFormat implements FileFormat<byte[]> {

    /**
     * Format ID for raw binary data.
     */
    public static final String FORMAT_BIN = "bin";

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * Create {@link RawBytesFileFormat}. See {@link FileFormat#bytes()} for more
     * details.
     */
    RawBytesFileFormat() {
    }

    @Nonnull
    @Override
    public String format() {
        return FORMAT_BIN;
    }

    @Override
    public boolean equals(Object obj) {
        return obj instanceof RawBytesFileFormat;
    }

    @Override
    public int hashCode() {
        return 0;
    }
}
